const state = {
  list: [{
    username: '猴子',
    phoneNamber: '125125335'

  }, {
    username: '吉吉国王',
    phoneNamber: '225125125'

  }, {
    username: '秋风萧瑟',
    phoneNamber: '325125125'
  }, {

    username: '洪波涌起',
    phoneNamber: '425125125'
  }, {
    username: '春风不语',
    phoneNamber: '525125125'
  }, {
    username: '遇之不易',
    phoneNamber: '625125125'
  }, {
    username: '一本正经',
    phoneNamber: '725125125'
  }, {
    username: '惊涛骇浪',
    phoneNamber: '825125125'
  }, {
    username: '浪花朵朵',
    phoneNamber: '925125125'
  }, {
    username: '夺命飞刀',
    phoneNamber: '15525125125'
  }, {
    username: '刀山火海',
    phoneNamber: '12535125125'
  }]
}

const mutations = {
  updateList(state, data) {
    state.list.push(...data)
  },
  deletee(state, username) {
    // 使用filter方法 筛选完数据 使用return  返回  并且要用数据接收一下
    state.list = state.list.filter(item => {
      return item.username !== username
    })
    // 能不能直接把参数传过来 然后利用splice删除
    // 你可以在那边先找到么，然后传
  } // 不起作用
}
export default {
  namespaced: true,
  state,
  mutations
}
